Public Class WSResponseTrade

    Sub New()

    End Sub
    Sub New(ByVal WSResponse As GTSSWebService.FxTradeDownloadType)
        sCPBIC = WSResponse.counterparty.bic
        sCPName = WSResponse.counterparty.name
        sCustBIC = WSResponse.custodian.bic
        sCustBIC = WSResponse.custodian.name
        sFundLegalName = WSResponse.fund.legalName
        sFundDisplayCode = WSResponse.fund.ownerDisplayCode
        sFund = WSResponse.fund.ownerInternalCode
        lGLID = WSResponse.globalLinkId
        sOwnerBIC = WSResponse.owner.bic
        sOwnerBIC = WSResponse.owner.name
        sSide = WSResponse.side
        decAmtBought = WSResponse.tradeDetails.amtBought
        decAmtSold = WSResponse.tradeDetails.amtSold
        sCCYBought = WSResponse.tradeDetails.currBought
        sCCYSold = WSResponse.tradeDetails.currSold
        dFixingDate = WSResponse.tradeDetails.fixingDate
        bFixingDateSpecified = WSResponse.tradeDetails.fixingDateSpecified
        decRate = WSResponse.tradeDetails.rate
        dSettleDate = WSResponse.tradeDetails.settleDate
        dTradeDate = WSResponse.tradeDetails.tradeDate
        sTransID = WSResponse.tradeDetails.transactionId
        sAffirmation = WSResponse.tradeStatus.affirmation
        dAuditTime = WSResponse.tradeStatus.auditTime
        sComments = WSResponse.tradeStatus.comments
        dCreatedTime = WSResponse.tradeStatus.created
        sMatchDescription = WSResponse.tradeStatus.matchDescription
        lMatchGLID = WSResponse.tradeStatus.matchGlobalLinkId
        bMatchGLIDSpecified = WSResponse.tradeStatus.matchGlobalLinkIdSpecified
        sSIBought = WSResponse.tradeStatus.siBought
        sSISold = WSResponse.tradeStatus.siSold
        sStatus = WSResponse.tradeStatus.status

        If WSResponse.tradeDetails.settlementDetails.buyDeliveryAgent Is Nothing Then
            sBuyDelivAgent = String.Empty
        Else
            sBuyDelivAgent = WSResponse.tradeDetails.settlementDetails.buyDeliveryAgent.Value
        End If

        If WSResponse.tradeDetails.settlementDetails.buyIntermediary Is Nothing Then
            sBuyInter = String.Empty
        Else
            sBuyInter = WSResponse.tradeDetails.settlementDetails.buyIntermediary.Value
        End If
        If WSResponse.tradeDetails.settlementDetails.buyReceivingAgent Is Nothing Then
            sBuyRecAgent = String.Empty
        Else
            sBuyRecAgent = WSResponse.tradeDetails.settlementDetails.buyReceivingAgent.Value
        End If

        sCommRefID = WSResponse.tradeDetails.settlementDetails.commRefId
        If WSResponse.tradeDetails.settlementDetails.sellBeneficiaryInst Is Nothing Then
            sSellBeneInst = String.Empty
        Else
            sSellBeneInst = WSResponse.tradeDetails.settlementDetails.sellBeneficiaryInst.Value
        End If

        If WSResponse.tradeDetails.settlementDetails.sellDeliveryAgent Is Nothing Then
            sSellDelivAgent = String.Empty
        Else
            sSellDelivAgent = WSResponse.tradeDetails.settlementDetails.sellDeliveryAgent.Value
        End If
        If WSResponse.tradeDetails.settlementDetails.sellIntermediary Is Nothing Then
            sSellInter = String.Empty
        Else
            sSellInter = WSResponse.tradeDetails.settlementDetails.sellIntermediary.Value
        End If
        If WSResponse.tradeDetails.settlementDetails.sellReceivingAgent Is Nothing Then
            sSellRecAgent = String.Empty
        Else
            sSellRecAgent = WSResponse.tradeDetails.settlementDetails.sellReceivingAgent.Value
        End If
        If WSResponse.tradeDetails.settlementDetails.senderToReceiverInfo Is Nothing Then
            sSenderToRecInfo = String.Empty
        Else
            sSenderToRecInfo = WSResponse.tradeDetails.settlementDetails.senderToReceiverInfo
        End If


    End Sub

    Private bCPBICPresent As Boolean
    Public Property CPBICPresent() As Boolean
        Get
            Return bCPBICPresent
        End Get
        Set(ByVal value As Boolean)
            bCPBICPresent = value
        End Set
    End Property


    Private sCPBIC As String
    Public Property CPBIC() As String
        Get
            Return sCPBIC
        End Get
        Set(ByVal value As String)
            sCPBIC = value
        End Set
    End Property

    Private sCPName As String
    Public Property CPName() As String
        Get
            Return sCPName
        End Get
        Set(ByVal value As String)
            sCPName = value
        End Set
    End Property

    Private sCustBIC As String
    Public Property CustBIC() As String
        Get
            Return sCustBIC
        End Get
        Set(ByVal value As String)
            sCustBIC = value
        End Set
    End Property

    Private sCustName As String
    Public Property CustName() As String
        Get
            Return sCustName
        End Get
        Set(ByVal value As String)
            sCustName = value
        End Set
    End Property

    Private sFundLegalName As String
    Public Property FundLegalName() As String
        Get
            Return sFundLegalName
        End Get
        Set(ByVal value As String)
            sFundLegalName = value
        End Set
    End Property


    Private sFundDisplayCode As String
    Public Property FundDisplayCode() As String
        Get
            Return sFundDisplayCode
        End Get
        Set(ByVal value As String)
            sFundDisplayCode = value
        End Set
    End Property

    Private sFund As String
    Public Property Fund() As String
        Get
            Return sFund
        End Get
        Set(ByVal value As String)
            sFund = value
        End Set
    End Property

    'GloballinkID is 9 digit number - not transaction id
    Private lGLID As Long
    Public Property GLID() As Long
        Get
            Return lGLID
        End Get
        Set(ByVal value As Long)
            lGLID = value
        End Set
    End Property

    Private sOwnerBIC As String
    Public Property OwnerBIC() As String
        Get
            Return sOwnerBIC
        End Get
        Set(ByVal value As String)
            sOwnerBIC = value
        End Set
    End Property

    Private sOwnerName As String
    Public Property OwnerName() As String
        Get
            Return sOwnerName
        End Get
        Set(ByVal value As String)
            sOwnerName = value
        End Set
    End Property

    Private sSide As String
    Public Property Side() As String
        Get
            Return sSide
        End Get
        Set(ByVal value As String)
            sSide = value
        End Set
    End Property
    '##################
    'Trade Details Items except Settlement Details
    '##################

    Private decAmtBought As Decimal
    Public Property AmtBought() As Decimal
        Get
            Return decAmtBought
        End Get
        Set(ByVal value As Decimal)
            decAmtBought = value
        End Set
    End Property

    Private decAmtSold As Decimal
    Public Property AmtSold() As Decimal
        Get
            Return decAmtSold
        End Get
        Set(ByVal value As Decimal)
            decAmtSold = value
        End Set
    End Property

    Private sCCYBought As String
    Public Property CCYBought() As String
        Get
            Return sCCYBought
        End Get
        Set(ByVal value As String)
            sCCYBought = value
        End Set
    End Property

    Private sCCYSold As String
    Public Property CCYSold() As String
        Get
            Return sCCYSold
        End Get
        Set(ByVal value As String)
            sCCYSold = value
        End Set
    End Property

    Private dFixingDate As Date
    Public Property FixingDate() As Date
        Get
            Return dFixingDate
        End Get
        Set(ByVal value As Date)
            dFixingDate = value
        End Set
    End Property

    Private bFixingDateSpecified As Boolean
    Public Property FixingDateSpecified() As Boolean
        Get
            Return bFixingDateSpecified
        End Get
        Set(ByVal value As Boolean)
            bFixingDateSpecified = value
        End Set
    End Property

    Private decRate As Decimal
    Public Property Rate() As Decimal
        Get
            Return decRate
        End Get
        Set(ByVal value As Decimal)
            decRate = value
        End Set
    End Property

    Private dSettleDate As Date
    Public Property SettleDate() As Date
        Get
            Return dSettleDate
        End Get
        Set(ByVal value As Date)
            dSettleDate = value
        End Set
    End Property

    Private dTradeDate As Date
    Public Property TradeDate() As Date
        Get
            Return dTradeDate
        End Get
        Set(ByVal value As Date)
            dTradeDate = value
        End Set
    End Property

    Private sTransID As String
    Public Property TransID() As String
        Get
            Return sTransID
        End Get
        Set(ByVal value As String)
            sTransID = value
        End Set
    End Property
    '##################
    'Trade Status Items
    '##################


    Private sAffirmation As String
    Public Property Affirmation() As String
        Get
            Return sAffirmation
        End Get
        Set(ByVal value As String)
            sAffirmation = value
        End Set
    End Property

    Private dAuditTime As Date
    Public Property AuditTime() As Date
        Get
            Return dAuditTime
        End Get
        Set(ByVal value As Date)
            dAuditTime = value
        End Set
    End Property

    Private sComments As String
    Public Property Comments() As String
        Get
            Return sComments
        End Get
        Set(ByVal value As String)
            sComments = value
        End Set
    End Property

    Private dCreatedTime As Date
    Public Property CreatedTime() As Date
        Get
            Return dCreatedTime
        End Get
        Set(ByVal value As Date)
            dCreatedTime = value
        End Set
    End Property

    Private sMatchDescription As String
    Public Property MatchDescription() As String
        Get
            Return sMatchDescription
        End Get
        Set(ByVal value As String)
            sMatchDescription = value
        End Set
    End Property

    Private lMatchGLID As Long
    Public Property MatchGLID() As Long
        Get
            Return lMatchGLID
        End Get
        Set(ByVal value As Long)
            lMatchGLID = value
        End Set
    End Property

    Private bMatchGLIDSpecified As Boolean
    Public Property MatchFieldSpecified() As Boolean
        Get
            Return bMatchGLIDSpecified
        End Get
        Set(ByVal value As Boolean)
            bMatchGLIDSpecified = value
        End Set
    End Property

    Private sSIBought As String
    Public Property SIBought() As String
        Get
            Return sSIBought
        End Get
        Set(ByVal value As String)
            sSIBought = value
        End Set
    End Property

    Private sSISold As String
    Public Property SISold() As String
        Get
            Return sSISold
        End Get
        Set(ByVal value As String)
            sSISold = value
        End Set
    End Property

    Private sStatus As String
    Public Property Status() As String
        Get
            Return sStatus
        End Get
        Set(ByVal value As String)
            sStatus = value
        End Set
    End Property

    '#######################
    'Settlement Detail Items
    '#######################


    Private sBuyDelivAgent As String
    Public Property BuyDelivAgent() As String
        Get
            Return sBuyDelivAgent
        End Get
        Set(ByVal value As String)
            sBuyDelivAgent = value
        End Set
    End Property

    Private sBuyInter As String
    Public Property BuyInter() As String
        Get
            Return sBuyInter
        End Get
        Set(ByVal value As String)
            sBuyInter = value
        End Set
    End Property

    Private sBuyRecAgent As String
    Public Property BuyRecAgent() As String
        Get
            Return sBuyRecAgent
        End Get
        Set(ByVal value As String)
            sBuyRecAgent = value
        End Set
    End Property

    Private sCommRefID As String
    Public Property CommRefID() As String
        Get
            Return sCommRefID
        End Get
        Set(ByVal value As String)
            sCommRefID = value
        End Set
    End Property

    Private sSellBeneInst As String
    Public Property SellBeneInst() As String
        Get
            Return sSellBeneInst
        End Get
        Set(ByVal value As String)
            sSellBeneInst = value
        End Set
    End Property

    Private sSellDelivAgent As String
    Public Property SellDelivAgent() As String
        Get
            Return sSellDelivAgent
        End Get
        Set(ByVal value As String)
            sSellDelivAgent = value
        End Set
    End Property

    Private sSellInter As String
    Public Property SellInter() As String
        Get
            Return sSellInter
        End Get
        Set(ByVal value As String)
            sSellInter = value
        End Set
    End Property

    Private sSellRecAgent As String
    Public Property SellRecAgent() As String
        Get
            Return sSellRecAgent
        End Get
        Set(ByVal value As String)
            sSellRecAgent = value
        End Set
    End Property

    Private sSenderToRecInfo As String
    Public Property SenderToRecInfo() As String
        Get
            Return sSenderToRecInfo
        End Get
        Set(ByVal value As String)
            sSenderToRecInfo = value
        End Set
    End Property



End Class
